package cn.com.surker.report.dao;

import cn.com.surker.report.entity.ReportFinance;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 经营分析 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2022-09-14
 */
public interface ReportFinanceDao extends BaseMapper<ReportFinance> {

    /**
     * 统计某个时间段净收入
     * @param startDate
     * @param endDate
     * @return
     */
    Double statisticsIncome(String startDate, String endDate);

    /**
     * 统计某个时间段净收入
     * @param startDate
     * @param endDate
     * @return
     */
    Double statisticsSaleCost(String startDate, String endDate, Long orgId);

    /**
     * 统计某个时间段净收入
     * @param startDate
     * @param endDate
     * @return
     */
    Double statisticsPayCost(String startDate, String endDate, Long orgId);

    /**
     * 统计集团周报
     * @param startDate
     * @param endDate
     * @return
     */
    List<ReportFinance> queryGroupWeekData(String startDate, String endDate);

    /**
     * 查询历史数据
     * @param orgId
     * @param today
     * @return
     */
    List<ReportFinance> queryByOneReport(Long orgId, String today, Integer type);

    /**
     * 查询月报统计数据
     * @param type
     * @param orgId
     * @param startDate
     * @param endDate
     * @return
     */
    ReportFinance queryMonthData(Integer type, Long orgId, String startDate, String endDate);

    /**
     * 查询年报统计数据
     * @param type
     * @param orgId
     * @param startDate
     * @param endDate
     * @return
     */
    List<ReportFinance> queryYearData(Integer type, Long orgId, String startDate, String endDate);

}
